<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        *{
            padding:0;
            margin:0;
        }
        p{
            border:1px solid tomato;
            background:palevioletred;
        }
    </style>
</head>
<body>
<form action="https://www.baidu.com/s">
    <input type="text" name="word" autocomplete="off">
</form>
<div id="root"></div>
</body>
<script type="module">
    import jsonp from "./index.js";
    document.querySelector("input").oninput = async function () {
        const {g=[]} =await jsonp({
            url:"https://www.baidu.com/sugrec",
            params:{
                prod:"pc",
                wd:this.value
            },
            jsonp:"cb"
        });
        document.querySelector("#root").innerHTML = g.map(item=>(`
		    <p>${item.q}</p>
		`)).join("");
    }
</script>
</html>